import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import AutoImport from 'unplugin-auto-import/vite'
import requireTransform from 'vite-plugin-require-transform';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    AutoImport({
      // 自动导入
      imports:['vue','vue-router']
    }),
    requireTransform({
      fileRegex: /.js$|.vue$/
    })
  ],
  server:{
    proxy:{
      '/api':'http://testapi.xuexiluxian.cn'
    }
  },
  resolve: {
    alias: {
      '@': path.join(__dirname, 'src')
    }
  },
})
